/**
 * 服务器地址
 */
export const serverUrl = 'https://hdf-app-server.penkuoer.com';

/**
 * 图片上传路径
 */
export const uploadActionUrl = serverUrl + '/common/upload';

/**
 * 处理图片数据
 * @param img
 * @returns
 */
export const dalImg = (img: string) => {
  if (img) {
    if (img.startsWith('http')) return img;
    return serverUrl + img;
  }
  return 'https://img1.baidu.com/it/u=2182845970,1459012964&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500';
};

export const setToken = (token: string) => sessionStorage.setItem('token', token);

export const getToken = () => sessionStorage.getItem('token');
